  //获取login

        var login=document.querySelector('.login')
        var span
        var inTime,outTime
        var isIn = true
        var isOut 
        //鼠标进入事件
        login.addEventListener('mouseenter',function(e){
      
            if(isIn){
            isIn=false
            inTime=new Date().getTime()
            span =document.createElement('span')
            login.appendChild(span)
            var left=e.clientX-e.target.offsetLeft
            var top=e.clientY-e.target.offsetTop
            span.style.top=`${top}px`
            span.style.left=`${left}px`
            span.style.animation='in .5s ease-out forwards'
            isOut = true 
            }
            
        })
        login.addEventListener('mouseleave',function(e){
            if (isOut) {
                isOut=false
                outTime=new Date().getTime()
                var passTime = outTime - inTime 
                if (passTime<=500) {
                    setTimeout(mouseleave,500-passTime)
                }
                else{
                    mouseleave()
                }
            
                function mouseleave(){
                    span.style.animation='out .5s ease-in forwards'
                    var left=e.clientX-e.target.offsetLeft
                    var top=e.clientY-e.target.offsetTop
                    span.style.top=`${top}px`
                    span.style.left=`${left}px`
                    setTimeout(() => {
                        login.removeChild(span)
                        isIn=true
                    }, 500); 
                }
            }
        })
        var inputList=document.querySelectorAll('.input input')
        inputList.forEach((input)=>{
            input.addEventListener('focus',focus)
            function focus(){
                this.parentElement.className="input focus"
                console.log(this.parentElement.className);
            }
            input.addEventListener('blur',function(){
                if (this.value==='') {
                    this.parentElement.className="input"
                }
            })
        })
        var reg=document.getElementById('reg')
        var log=document.getElementById('log')
        var email=document.getElementById('email')
        var repeat=document.getElementById('repeat')
        log.addEventListener('click',()=>{
            repeat.className="input none"
            email.className="input none"
            email.querySelector('input').disabled="disabled"
            repeat.querySelector('input').disabled="disabled"
            email.style.cursor=""
            repeat.style.cursor=""
        })
        reg.addEventListener('click',()=>{
            repeat.className="input"
            email.className="input"
            email.querySelector('input').disabled=""
            repeat.querySelector('input').disabled=""
            email.querySelector('input').style.cursor='pointer'
            repeat.querySelector('input').style.cursor='pointer'
        })